package jk.zmn.thread.create;

/**
 * @author 张梦楠
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2018/5/2614:31
 * @blog www.itzmn.com
 *
 *
 */
public class ThreadDemo2 {

     public static void main(String[] args) {
         Thread one = new Thread(new Demo2("线程1"));
         one.start();
         for (int j=0;j<100;j++){
             System.out.println("zhangsan--"+j);
         }
     }
}

class Demo2 implements Runnable{
    public String name;
    public Demo2(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i =0;i<100;i++){
            System.out.println(name+"--"+i);
        }
    }
}